<style type="text/css">
.nav-sidebar .sub-menu {
	list-style-type: none;
	padding: 0;
}

.nav-sidebar .sub-menu a {
	padding-top: 5px;
	padding-bottom: 5px;
	padding-left: 30px;
	font-size: 12px;
	font-weight: 400;
}

.nav>li>span {
	position: relative;
	display: block;
	padding: 10px 15px;
}

.leftBox {
	padding-top: 10px;
	position: fixed;
	width: 165px;
	height: 500px;
	overflow-y: scroll;
	border: 1px solid #eaecef;
	word-break:break-all;
　　word-wrap:break-word;
}

.leftBox a {
	color: #333;
}

.leftBox li.active a {
	color: #35b558 !important;
}

.right-side-bar {
	width: 100px;
	position: fixed;
	bottom: 32px;
	right: 0px;
	padding-left:3px;
	border: 1px solid #eaecef;
	background-color: #fff;
}
.right-side-bar ul {
	list-style-type: none;
	padding: 0;
	font-size:10px;
}

.right-side-bar ul li{
	padding-top: 4px;
}

.right-side-bar ul li a{
	color: #333;
	cursor:pointer;
}
.right-side-bar li a.active {
	color: #35b558 !important;
}
</style>

<ul id="leftBox" class="nav nav-sidebar leftBox">
	<li id="intro_index"><a href="${request.contextPath}/wiki/intro/index">简介</a></li>
	<li><span>用户指南</span></li>
	<ul class="nav sub-menu">
		<li id="userGuide_produceAndConsume"><a href="${request.contextPath}/wiki/userGuide/produceAndConsume">生产和消费</a></li>
		<li id="userGuide_client"><a href="${request.contextPath}/wiki/userGuide/client">客户端公共配置</a></li>
		<li id="userGuide_clientProducer"><a href="${request.contextPath}/wiki/userGuide/clientProducer">生产者接入</a></li>
		<li id="userGuide_clientConsumer"><a href="${request.contextPath}/wiki/userGuide/clientConsumer">消费者接入</a></li>
		<li id="userGuide_topic"><a href="${request.contextPath}/wiki/userGuide/topic">topic</a></li>
		<li id="userGuide_messageQuery"><a href="${request.contextPath}/wiki/userGuide/messageQuery">消息查询</a></li>
		<li id="userGuide_monitorAndWarn"><a href="${request.contextPath}/wiki/userGuide/monitorAndWarn">监控预警</a></li>
		<li id="userGuide_faq"><a href="${request.contextPath}/wiki/userGuide/faq">常见问题</a></li>
		<li id="userGuide_cgo"><a href="${request.contextPath}/wiki/userGuide/cgo">cgo接入</a></li>
		<li id="userGuide_go"><a href="${request.contextPath}/wiki/userGuide/go">go接入</a></li>
		<li id="userGuide_python"><a href="${request.contextPath}/wiki/userGuide/python">python接入</a></li>
	</ul>
	<#if userInfo.user.admin>
	<li><span>管理指南</span></li>
	<ul class="nav sub-menu">
		<li id="adminGuide_audit"><a href="${request.contextPath}/wiki/adminGuide/audit">流程审核</a></li>
		<li id="adminGuide_ns"><a href="${request.contextPath}/wiki/adminGuide/ns">集群发现</a></li>
		<li id="adminGuide_broker"><a href="${request.contextPath}/wiki/adminGuide/broker">集群管理</a></li>
		<li id="adminGuide_topology"><a href="${request.contextPath}/wiki/adminGuide/topology">集群拓扑</a></li>
		<li id="adminGuide_monitor"><a href="${request.contextPath}/wiki/adminGuide/monitor">监控管理</a></li>
		<li id="adminGuide_trafficMonitor"><a href="${request.contextPath}/wiki/adminGuide/trafficMonitor">流量监控</a></li>
		<li id="adminGuide_user"><a href="${request.contextPath}/wiki/adminGuide/user">用户管理</a></li>
		<li id="adminGuide_machine"><a href="${request.contextPath}/wiki/adminGuide/machine">机器管理</a></li>
		<li id="adminGuide_notify"><a href="${request.contextPath}/wiki/adminGuide/notify">通知管理</a></li>
		<li id="adminGuide_clientVersion"><a href="${request.contextPath}/wiki/adminGuide/clientVersion">客户端版本</a></li>
		<li id="adminGuide_feedback"><a href="${request.contextPath}/wiki/adminGuide/feedback">用户反馈</a></li>
		<li id="adminGuide_brokerConfig"><a href="${request.contextPath}/wiki/adminGuide/brokerConfig">配置模板</a></li>
		<li id="adminGuide_commonConfig"><a href="${request.contextPath}/wiki/adminGuide/commonConfig">通用配置</a></li>
		<li id="adminGuide_faq"><a href="${request.contextPath}/wiki/adminGuide/faq">常见问题</a></li>
	</ul>
	</#if>
	<li><span>开发指南</span></li>
	<ul class="nav sub-menu">
		<li id="developerGuide_intro"><a href="${request.contextPath}/wiki/developerGuide/intro">介绍</a></li>
		<li id="developerGuide_nameServer"><a href="${request.contextPath}/wiki/developerGuide/nameServer">NameServer寻址</a></li>
		<li id="developerGuide_client"><a href="${request.contextPath}/wiki/developerGuide/client">客户端</a></li>
		<li id="developerGuide_statMonitorWarning"><a href="${request.contextPath}/wiki/developerGuide/statMonitorWarning">统计监控预警</a></li>
		<li id="developerGuide_messageTrace"><a href="${request.contextPath}/wiki/developerGuide/messageTrace">消息追踪</a></li>
		<li id="developerGuide_api"><a href="${request.contextPath}/wiki/developerGuide/api">api汇总</a></li>
	</ul>
	<li><span>疑难杂症</span></li>
	<ul class="nav sub-menu">
		<li id="troubleshooting_sendMessageRetry"><a href="${request.contextPath}/wiki/troubleshooting/sendMessageRetry">1.broker僵死时客户端发送消息支持重试</a></li>
		<li id="troubleshooting_brokerOverload"><a href="${request.contextPath}/wiki/troubleshooting/brokerOverload">2.broker负载过高</a></li>
		<li id="troubleshooting_nameServerUpdateBug"><a href="${request.contextPath}/wiki/troubleshooting/nameServerUpdateBug">3.NameServer更新导致客户端No topic route info in name server for the topic</a></li>
		<li id="troubleshooting_broadcastingOffsetMovedEvent"><a href="${request.contextPath}/wiki/troubleshooting/broadcastingOffsetMovedEvent">4.广播消费模式的消费者OFFSET_MOVED_EVENT预警问题调查</a></li>
		<li id="troubleshooting_slaveFallBehindMaster"><a href="${request.contextPath}/wiki/troubleshooting/slaveFallBehindMaster">5.slave落后master数据量为负</a></li>
		<li id="troubleshooting_subscriptionNotLatest"><a href="${request.contextPath}/wiki/troubleshooting/subscriptionNotLatest">6.subscriptionNotLatest</a></li>
		<li id="troubleshooting_broadcastingResetOffset"><a href="${request.contextPath}/wiki/troubleshooting/broadcastingResetOffset">7.广播消费模式实现offset重置</a></li>
	</ul>
</ul>
<script type="text/javascript">
	$(function(){
		var id = window.location.pathname.substring(6).replace(/\//g,"_");
		$("#"+id).addClass("active");
		$("#leftBox").niceScroll({
			cursorcolor : "#ddd",
			horizrailenabled : false
		});
		$(".right-side-bar a").each(function(){
			$(this).click(function(){
				$("html,body").animate({scrollTop: $($(this).attr('href')).offset().top - 52}, 500);
				return false;
			});
		});
		$(".right-side-bar a:first").addClass("active");
		//浏览器滚动条滚动触发的事件
	    $(window).scroll(function() {
	        //获取当前滚动条的高度
	        var scrollTop = $(window).scrollTop();
	        if(scrollTop <= 0) {
	        	$(".right-side-bar a").removeClass("active");
	        	$(".right-side-bar a:first").addClass("active");
	        	return;
	        }
	        var top = scrollTop + $(window).height() - 100;
	        //遍历所有的div
	        $(".markdown-body h2 > span").each(function(index) {
	            var thisTop = $(this).offset().top;
	            if (top >= thisTop) {
	                $(".right-side-bar a").removeClass("active");
	                $(".right-side-bar a[href='#"+$(this).attr("id")+"']").addClass("active");
	            }
	        });
	    });
		
	    var page = window.location.pathname.substr(6);
	    page = page.replace(/\//g, "_");
	    if(page && $("#"+page).offset()){
	    	if($("#"+page).offset().top > 510){
				$("#leftBox").animate({scrollTop: $("#"+page).offset().top - 81}, 1000);
	    	}
		}
	});
</script>